package com.atguigu.msmservice.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 常量类，读取配置文件application.properties中的配置
 */
@Component
public class PropertiesUtil implements InitializingBean {
    @Value("${spring.qq.smtp.hostname}")
    private String hostname;
    @Value("${spring.qq.smtp.emali}")
    private String emali;
    @Value("${spring.qq.smtp.password}")
    private String password;

    public static String HOSTNAME;
    public static String EMALI;
    public static String NAME;
    public static String PASSWORD;
    @Override
    public void afterPropertiesSet() throws Exception {
        HOSTNAME = hostname;
        EMALI = emali;
        PASSWORD = password;
    }
}


